/*
 * @Description: Test01Animal
 * 
 * @Author: 平常心
 * 
 * @Date: 2024-09-20 08:47:23
 * 
 * @LastEditors: 平常心
 * 
 * @LastEditTime: 2024-09-20 09:53:34
 */
package day19;

/**
 * Test01Animal
 */
public class Test01Animal {
  public static void main(String[] args) {
    // 创建对象
    // 抽象类不可以实例化对象
    // Animal animal = new Animal();
    // animal.eat();
    // animal.sleep();
    // Cat cat = new Cat();
    // cat.eat();
    // cat.sleep();
    Animal dog = new Dog();
    dog.eat();
    // dog.sleep();
    // 子类对象指向父类引用
    Animal cat = new Cat("yellow", 2, "三花");
    cat.eat();
    cat.sleep();
    System.out.println("cat" + cat);
    System.out.println("cat.toString()" + cat.toString());
  }
}